<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="perm" uri="/WEB-INF/tld/perm.tld"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script>var ctx="${ctx}";</script>
<div class="form-horizontal" role="form" >
<!-- 	<div class="form-group"> -->
<!--  	    <label class="col-md-3 col-sm-3 control-label">会员:</label> -->
<!--         <div class="col-md-9"> -->
<%--         	 <input id="memberId" value="${orderComment.memberId}"  type="text" placeholder="会员" class="form-control" name="memberId"/> --%>
<!--         </div> -->
<!--     </div> -->
    <div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">会员:</label>
        <div class="col-md-9">
        	  <select id="memberId" data-placeholder="选择商品分类" class="chosen-select full-width"  tabindex="4">
			</select>
        </div>
    </div>
<!-- 	<div class="form-group"> -->
<!--  	    <label class="col-md-3 col-sm-3 control-label">商品:</label> -->
<!--         <div class="col-md-9"> -->
<%--         	 <input id="goodsId" value="${orderComment.goodsId}"  type="text" placeholder="商品" class="form-control" name="goodsId"/> --%>
<!--         </div> -->
<!--     </div> -->
    <div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">商品:</label>
        <div class="col-md-9">
        	  <select id="goodsId" data-placeholder="选择商品分类" class="chosen-select full-width"  tabindex="4">
			</select>
        </div>
    </div>
	<div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">订单id:</label>
        <div class="col-md-9">
        	 <input id="orderId" value="${orderComment.orderId}"  type="text" placeholder="订单id" class="form-control" name="orderId"/>
        </div>
    </div>
<!-- 	<div class="form-group"> -->
<!--  	    <label class="col-md-3 col-sm-3 control-label">商户:</label> -->
<!--         <div class="col-md-9"> -->
<%--         	 <input id="merchantId" value="${orderComment.merchantId}"  type="text" placeholder="商户" class="form-control" name="merchantId"/> --%>
<!--         </div> -->
<!--     </div> -->
    <div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">商户:</label>
        <div class="col-md-9">
        	  <select id="merchantId" data-placeholder="选择商品分类" class="chosen-select full-width"  tabindex="4">
			</select>
        </div>
    </div>
	<div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">质量:</label>
        <div class="col-md-9">
        	 <input id="quality" value="${orderComment.quality}"  type="text" placeholder="质量" class="form-control" name="quality"/>
        </div>
    </div>
	<div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">速度:</label>
        <div class="col-md-9">
        	 <input id="speed" value="${orderComment.speed}"  type="text" placeholder="速度" class="form-control" name="speed"/>
        </div>
    </div>
	<div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">态度:</label>
        <div class="col-md-9">
        	 <input id="attitude" value="${orderComment.attitude}"  type="text" placeholder="态度" class="form-control" name="attitude"/>
        </div>
    </div>
	<div class="form-group">
 	    <label class="col-md-3 col-sm-3 control-label">创建时间:</label>
        <div class="col-md-9">
        	 <input id="creatDate" value="${orderComment.creatDate}"  type="text" placeholder="创建时间" class="form-control" name="creatDate"/>
        </div>
    </div>
</div>

<script>
$(function(){
	$("#memberId").chosen({ width: '100%' });
	$("#goodsId").chosen({ width: '100%' });
	$("#merchantId").chosen({ width: '100%' });
    $.ajax({  
		url:'${ctx}/member/list',  		 					
		type: 'POST',
		dataType:'json',  
		success:function(response){
			if(response.code==0){
				var html=[];
				var data=response.data||[];
				for(var i=0;i<data.length;i++){
					html.push('<option value="'+data[i].id+'">'+data[i].name+'</option>');
				}
				$("#memberId").append(html.join(""));
				$("#memberId").trigger("chosen:updated");
			}
		 }  
     });
    
    $.ajax({  
		url:'${ctx}/goods/list',  		 					
		type: 'POST',
		dataType:'json',  
		success:function(response){
			if(response.code==0){
				var html=[];
				var data=response.data||[];
				for(var i=0;i<data.length;i++){
					html.push('<option value="'+data[i].id+'">'+data[i].name+'</option>');
				}
				$("#goodsId").append(html.join(""));
				$("#goodsId").trigger("chosen:updated");
			}
		 }  
     });
    $.ajax({  
		url:'${ctx}/merchant/list',  		 					
		type: 'POST',
		dataType:'json',  
		success:function(response){
			if(response.code==0){
				var html=[];
				var data=response.data||[];
				for(var i=0;i<data.length;i++){
					html.push('<option value="'+data[i].id+'">'+data[i].name+'</option>');
				}
				$("#merchantId").append(html.join(""));
				$("#merchantId").trigger("chosen:updated");
			}
		 }  
     });
}); 	
</script>